﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" 
    CodeFile="ProductManagement.aspx.cs" Inherits="System_ProductManagement" Title="产品信息维护" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

<script language="javascript"  type="text/javascript">
    function ConfirmDelte()
    {
         Alert("nnn");
    }
</script>
    <table style="width: 100%">
        <tr>
            <td>
                <table>
                    <tr>
                        <td>
                            <asp:Label ID="Label_Type" runat="server" Text="<%$ Resources:ProductType.Text %>" 
                               ></asp:Label>  
                                
                        </td>
                        <td>
                            <asp:DropDownList ID="DrpProductTypeList" runat="server" AutoPostBack="True" 
                                DataSourceID="ObjectDataSource_ProductTypeList" DataTextField="ProductTypeName" 
                                DataValueField="ProductTypeID" Width="140px" 
                                OnSelectedIndexChanged="DrpProductTypeList_SelectedIndexChanged" 
                                meta:resourcekey="DrpProductTypeListResource1" >
                            </asp:DropDownList>
                            
                        </td>
                        <td>
                            <asp:Label ID="Label_Code" runat="server" 
                                meta:resourcekey="ProductCode" 
                                Text="<%$ Resources:ProductTypeCode.Text %>" ></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBoxFindCode" runat="server" 
                                meta:resourcekey="TextBoxFindCodeResource1"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Button ID="ButtonFind" runat="server" Text="查找" OnClick="ButtonFind_Click" 
                                meta:resourcekey="ButtonFindResource1" Font-Bold="False" Font-Overline="False" 
                                Font-Strikeout="False" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table border="1px" cellpadding="1" cellspacing="1" width="100%">
                    <tr>
                        <td valign="top">
                            <asp:GridView ID="GridViewProductsList" SkinId="DataCollections_View" runat="server" 
                                AllowPaging="True" AllowSorting="True"
                                DataSourceID="ObjectDataSource_Products" AutoGenerateColumns="False" DataKeyNames="ProductID,ProductTypeID" 
                                OnRowCommand="GridViewProductsList_RowCommand"
                                onsorting="GridViewProductsList_Sorting" 
                                meta:resourcekey="GridViewProductsListResource1">
                                <Columns>
                                    <asp:BoundField DataField="ProductID" HeaderText="ProductID" InsertVisible="False"
                                        ReadOnly="True" SortExpression="ProductID" Visible="False" 
                                        meta:resourcekey="BoundFieldResource1" />
                                    <asp:BoundField DataField="ProductTypeID" HeaderText="ProductTypeID" InsertVisible="False"
                                        ReadOnly="True" SortExpression="ProductTypeID" Visible="False" 
                                        meta:resourcekey="BoundFieldResource2" />
                                    <asp:BoundField DataField="ProductTypeCode" HeaderText="ProductTypeCode" SortExpression="ProductTypeCode"
                                        Visible="False" meta:resourcekey="BoundFieldResource3" />
                                    <asp:BoundField DataField="ProductTypeName" HeaderText="产品类别" 
                                        SortExpression="ProductTypeName" meta:resourcekey="BoundFieldResource4"  />
                                    <asp:BoundField DataField="ProductCode" HeaderText="产品编码"
                                        SortExpression="ProductCode" meta:resourcekey="BoundFieldResource5" />
                                    <asp:BoundField DataField="ProductName" HeaderText="产品名称" 
                                        SortExpression="ProductName" meta:resourcekey="BoundFieldResource6" />
                                    <asp:BoundField DataField="ProductModule" HeaderText="产品规格" 
                                        SortExpression="ProductModule" meta:resourcekey="BoundFieldResource7" />
                                    <asp:BoundField DataField="ProductColor" HeaderText="产品颜色" 
                                        SortExpression="ProductColor" meta:resourcekey="BoundFieldResource8" />
                                    <asp:BoundField DataField="ProductPrice" HeaderText="产品价格" 
                                        SortExpression="ProductPrice" meta:resourcekey="BoundFieldResource9" />
                                    <asp:ButtonField ButtonType="Button" CommandName="DoUpdate" Text="修改" 
                                        meta:resourcekey="ButtonFieldResource1" />
                                    <asp:ButtonField  ButtonType="Button" CommandName="DoDelete" Text="删除" 
                                        meta:resourcekey="ButtonFieldResource2" />
                                </Columns>
                                <EmptyDataTemplate>
                                    <table id="ctl00_ContentPlaceHolder1_GridViewProductsList" border="1" cellpadding="4"
                                        cellspacing="0" rules="cols" style="border-top-width: 1px; border-left-width: 1px;
                                        border-left-color: #dedfde; border-bottom-width: 1px; border-bottom-color: #dedfde;
                                        color: black; border-top-color: #dedfde; border-collapse: collapse; background-color: white;
                                        border-right-width: 1px; border-right-color: #dedfde">
                                        <tr style="font-weight: bold; color: white; background-color: #6b696b">
                                            <th scope="col">
                                                <a 
                                                    style="color: white">产品类别</a></th>
                                            <th scope="col">
                                                <a 
                                                    style="color: white">产品编码</a></th>
                                            <th scope="col">
                                                <a 
                                                    style="color: white">产品名称</a></th>
                                            <th scope="col">
                                                <a 
                                                    style="color: white">产品规格</a></th>
                                            <th scope="col">
                                                <a 
                                                    style="color: white"></th>
                                            <th scope="col">
                                                <a 
                                                    style="color: white">产品价格</a></th>
                                            <th scope="col">
                                                &nbsp;</th>
                                            <th scope="col">
                                                &nbsp;</th>
                                        </tr>
                                        <tr style="background-color: #f7f7de">
                                            <td>
                                            </td>
                                            <td>
                                            </td>
                                            <td>
                                            </td>
                                            <td>
                                            </td>
                                            <td>
                                            </td>
                                            <td>
                                            </td>
                                            <td>
                                            </td>
                                            <td>
                                            </td>
                                        </tr>
                                    </table>
                                </EmptyDataTemplate>
                             
                            </asp:GridView>
                        </td>
                        <td>
                            <div runat="server" id="EditDiv" style="vertical-align: top">
                                <asp:Button ID="ButtonAddNew" runat="server" Text="新增" Style="width: 80px" 
                                    OnClick="ButtonAddNew_Click" meta:resourcekey="ButtonAddNewResource1" />
                                <asp:Button ID="ButtonCancle" runat="server" Text="取消" Style="width: 80px" 
                                    OnClick="ButtonCancle_Click" meta:resourcekey="ButtonCancleResource1" />&nbsp;
                                <table width="230px" style="vertical-align: top">
                                    <tr>
                                        <td align="right">
                                            &nbsp;<asp:Label ID="Label_Edit_Category" runat="server"  
                                                meta:resourcekey="ProductCategory"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="DropDownListProductTopType" runat="server" DataSourceID="ObjectDataSource_ProductCategories"
                                                DataTextField="ProductTypeName" DataValueField="ProductTypeCode" 
                                                Width="130px" AutoPostBack="True" 
                                                OnSelectedIndexChanged="DropDownListProductTopType_SelectedIndexChanged" 
                                                meta:resourcekey="DropDownListProductTopTypeResource1">
                                            </asp:DropDownList>&nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Label ID="Label_Edit_Type" runat="server" meta:resourcekey="ProductType"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="DropDownListProductList" runat="server" DataSourceID="ObjectDataSource_ProductTypes"
                                                DataTextField="ProductTypeName" DataValueField="ProductTypeID" 
                                                Width="130px" AutoPostBack="True" 
                                                OnSelectedIndexChanged="DropDownListProductList_SelectedIndexChanged" 
                                                meta:resourcekey="DropDownListProductListResource1">
                                            </asp:DropDownList>&nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Label ID="Label_Edit_Code" runat="server" meta:resourcekey="ProductTypeCode"/> </td>
                                        <td >
                                            <asp:TextBox ID="TextBoxProductTypeCode" runat="server" Width="50px" 
                                                ReadOnly="True" meta:resourcekey="TextBoxProductTypeCodeResource1"/>-<asp:TextBox 
                                                ID="TextBoxProductCode" runat="server" Width="50px" 
                                                meta:resourcekey="TextBoxProductCodeResource1"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Label ID="Label_Edit_Name" runat="server" meta:resourcekey="ProductName"/> </td>
                                        <td>
                                            <asp:TextBox ID="TextBoxProductName" runat="server" Width="120px" 
                                                meta:resourcekey="TextBoxProductNameResource1"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                             <asp:Label ID="Label_Edit_Module" runat="server" meta:resourcekey="ProductModule"/> </td>
                                        <td>
                                            <asp:TextBox ID="TextBoxProductModule" runat="server" Width="120px" 
                                                meta:resourcekey="TextBoxProductModuleResource1"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Label ID="Label_Edit_Color" runat="server" meta:resourcekey="ProductColor"/> </td>
                                        <td>
                                            <asp:TextBox ID="TextBoxProductColor" runat="server" Width="120px" 
                                                meta:resourcekey="TextBoxProductColorResource1"></asp:TextBox>
                                        </td>
                                    </tr>

                                    <tr>
                                        <td align="right">
                                           <asp:Label ID="Label_Edit_Price" runat="server" meta:resourcekey="ProductPrice"/> </td>
                                        <td style="width: 109px">
                                            <asp:TextBox ID="TextBoxProductPrice" runat="server" Width="120px" 
                                                meta:resourcekey="TextBoxProductPriceResource1"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <asp:Label ID="LabelError" runat="server" ForeColor="Red" 
                                                meta:resourcekey="LabelErrorResource1"></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                                <asp:Button ID="ButtonAdd" runat="server" Text="保存" Style="width: 80px" 
                                    OnClick="ButtonAdd_Click" meta:resourcekey="ButtonAddResource1" />
                                <asp:Button ID="ButtonAddMore" runat="server" Text="保存并继续新增" 
                                    Style="width: 100px" OnClick="ButtonAddMore_Click" 
                                    meta:resourcekey="ButtonAddMoreResource1" />
                                <asp:Button ID="ButtonUpdate" runat="server" Text="保存" Style="width: 80px" 
                                    OnClick="ButtonUpdate_Click" meta:resourcekey="ButtonUpdateResource1" />&nbsp;
                                
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>

    <asp:HiddenField ID="HiddenFieldProductID" runat="server" />
    
    <asp:ObjectDataSource ID="ObjectDataSource_ProductTypeList" runat="server" 
                                SelectMethod="GetAllProductTypes" TypeName="SystemBL">
                            </asp:ObjectDataSource>
                            
    <asp:ObjectDataSource ID="ObjectDataSource_Products" runat="server" 
        SelectMethod="GetProductsView" TypeName="SystemBL">
        <SelectParameters>
            <asp:ControlParameter ControlID="DrpProductTypeList" DefaultValue="-1" 
                Name="type" PropertyName="SelectedValue" Type="Int32" />
            <asp:Parameter DefaultValue="" Name="orderby"  Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
                            
    <asp:ObjectDataSource ID="ObjectDataSource_ProductTypes" runat="server" 
                                SelectMethod="GetProductTypes" TypeName="SystemBL">
          <SelectParameters>
              <asp:ControlParameter ControlID="DropDownListProductTopType" Name="category" PropertyName="SelectedValue"
                Type="String" />
            </SelectParameters>                      
    </asp:ObjectDataSource>    
                            
    <asp:ObjectDataSource ID="ObjectDataSource_ProductCategories" runat="server" 
                                SelectMethod="GetProductCategories" TypeName="SystemBL">
                            </asp:ObjectDataSource>                                                
</asp:Content>
